package com.filldream.fastboot.web.controller.pc;

import com.filldream.fastboot.common.annotation.PassTokenAnnotation;
import com.filldream.fastboot.common.annotation.RolePermissions;
import com.filldream.fastboot.common.entity.R;
import com.filldream.fastboot.core.service.MonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

@RestController
@RequiredArgsConstructor
@Api(tags = "PC-系统监控")
@RequestMapping("/pc/monitor")
public class PcMonitorController {

    private final MonitorService serverService;

    @PassTokenAnnotation
    @GetMapping
    @ApiOperation("服务监控")
    @RolePermissions("monitor:detail")
    public R<Map<String,Object>> queryMonitor(){
        return R.successd(serverService.getServers());
    }

}